package com.itqf.job;

import java.io.IOException;
import java.util.Date;

/**
 * @Description:
 * @Company: 千锋互联
 * @Author: 李丽婷
 * @Date: 2020/10/15
 * @Time: 下午4:10
 */
public class MyJob {

    public  void  execute() {
        System.out.println("执行了"+new Date().toGMTString());
        Runtime runtime = Runtime.getRuntime();

        String  fileName  = System.currentTimeMillis()+".sql";

        try {
            runtime.exec("mysqldump -uroot -padmin shirodb -r /Users/liliting/Desktop/code/part3/QuatrtzDemo02_Spring/"+fileName);
            System.out.println("备份成功");
        } catch (IOException e) {
            e.printStackTrace();
        }

    }

}
